package ooday01;

public class ExtendsTest {
    public static void main(String[] args) {
        Student WZQ=new Student("王子骞",20,"山东","jsd2507","123456789");
        WZQ.eat();
        WZQ.sleep();
        WZQ.sayHi();
        WZQ.sayHello();
        Doctor wpf = new Doctor("王鹏飞",45,"山西","主任医师");
        wpf.eat();
        wpf.sleep();
        wpf.sayHi();
        wpf.cut();

        //演示超类不能访问派生类的
        Person p = new Person();
        p.name = "人";
        p.age = 1;
        p.address = "未知";
        p.eat();
        p.sleep();
        p.sayHi();
        //p.stuId = "005"; //编译错误，超类不能访问派生类的
    }
}